import pypyodbc
import datetime
from pyecharts import Geo
from pyecharts import Bar
import webbrowser
import PySimpleGUI as sg


def Extract_database2(place):
    Str = 'Driver={Microsoft Access Driver (*.mdb)};PWD' + "" + ";DBQ=" + "C:\\Users\\Admin\\Desktop\\PM25（山东省全部城市-截止2014-11-20）.mdb"
    conn = pypyodbc.win_connect_mdb(Str)
    cur = conn.cursor()
    sql = "SELECT f_time,f_place,f_AQI,f_PM25per1h,f_PM10per1h,f_COper1h,f_NO2per1h,f_O3per1h,f_O3per8h,f_SO2per1h FROM t_pm25 WHERE f_place ='%s'" % place
    rows = cur.execute(sql)
    return rows